Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code bug in parse config file. #4

Closed
wants to merge 3 commits into from

Conversation

liuh-80
Copy link
Owner

@liuh-80 liuh-80 commented Nov 5, 2021

This PR is a draft PR to help review patch file change in sonic-net/sonic-buildimage#8715
The code change in this PR include:

  1. Because tacplus_nss.conf format issue, need update support.c to parse it correctly:
    Support debug=on setting.
    Support put server address and secret in same row.
  2. Fix the parse_config_file method not reset server list before parse config file issue.

support.c Outdated
@@ -246,7 +269,7 @@ void set_source_ip(const char *tac_source_ip) {
int _pam_parse_arg (const char *arg, char* current_secret, uint current_secret_buffer_size) {
int ctrl = 0;

if (!strcmp (arg, "debug")) { /* all */
if (!strcmp (arg, "debug") || !strcmp (arg, "debug=on")) { /* all */
Copy link

@qiluo-msft qiluo-msft Nov 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| !strcmp (arg, "debug=on")

Is it really needed? #Closed

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is necessary for debug.
The reason of this change is because the tacplus_nss.conf config file using debug=on to enable debug. so we need change code here to enabled debug with the 'debug=on' setting.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware of the syntax of tacplus_nss.conf. I found a sample https://github.com/stemid/tacacs/blob/master/libnss-tacplus/tacplus_nss.conf. Will you support debug=1 ?

support.c Show resolved Hide resolved
@qiluo-msft
Copy link

qiluo-msft commented Nov 9, 2021

Could you explain the motivation in code comment or in PR description?

@liuh-80
Copy link
Owner Author

liuh-80 commented Nov 11, 2021

Could you explain the motivation in code comment or in PR description?

Update the PR description in this PR: sonic-net/sonic-buildimage#8715

@liuh-80 liuh-80 closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants